<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="xml" indent="yes" encoding="UTF-8"/>

  <xsl:param name="shutdown_port" select="'8005'"/>
  <xsl:param name="shutdown_string" select="'shutdown'"/>
  <xsl:param name="listen_port" select="number(8080)"/>

  <!-- root Server element needs tomcat shutdow information -->
  <xsl:template match="Server"><xsl:text>
</xsl:text><!-- following warning does not apply to the XSLT -->
      <xsl:comment>== == == == == == == == == == == == == == == == == == == == == ==</xsl:comment><xsl:text>
</xsl:text>
      <xsl:comment>== == == DO NOT EDIT THIS FILE it is generated from a template ==</xsl:comment><xsl:text>
</xsl:text>
      <xsl:comment>== == == == == == == == == == == == == == == == == == == == == ==</xsl:comment><xsl:text>
</xsl:text>
    <Server>
      <xsl:attribute name="port">
        <xsl:value-of select="$shutdown_port"/>
      </xsl:attribute>
      <xsl:attribute name="shutdown">
        <xsl:value-of select="$shutdown_string"/>
      </xsl:attribute>
      <xsl:apply-templates select="@*|node()"/>
    </Server>
  </xsl:template>

  <xsl:template match="Connector">
    <Connector>
      <xsl:attribute name="port">
        <xsl:value-of select="$listen_port"/>
      </xsl:attribute>
      <xsl:apply-templates select="@*|node()"/>
    </Connector>
  </xsl:template>



  <!-- identity transform http://www.dpawson.co.uk/xsl/sect2/identity.html -->
  <!-- copy me and pay attention to my contents version -->
  <xsl:template match="*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates />
    </xsl:copy>
  </xsl:template>
  <xsl:template match="@*">
    <xsl:copy-of select="." />
  </xsl:template>

</xsl:stylesheet>
